/**
 * Created by hama on 2016/6/11.
 */


$('form').submit(function(e){
    e.preventDefault();
    var data = new FormData(this);
    $.post({
        url: '/user',
        data: data,
        contentType : false,
        processData: false,
        success: function(res){
            if(res.code == 'success'){
                location.href = '/'
            }
            else{
                $('.modal-body').text(res.message)
                $('.modal').modal('show')
            }
        }
    })
})